package jt.classic.system.workflow.impl;

import jt.classic.system.group.IGroup;
import jt.classic.system.user.IUser;
import jt.classic.system.workflow.WActivity;
import jt.classic.system.workflow.WExecutor;

import org.limp.basework.AbstractSimpleBean;

import java.util.Map;


/**
 * 流程执行人接口实现
 *
 * @author bizkit
 *
 */
public class WExecutorImpl extends AbstractSimpleBean implements WExecutor {
    private String ip;
    private String hostname;
    private String mac;
    private WActivity activity;
    private IUser user;
    private IGroup unit;
    private String username;
    private String unitname;
    private String postname;

    public WActivity iactivity() {
        // TODO Auto-generated method stub
        return this.activity;
    }

    public String ihostname() {
        // TODO Auto-generated method stub
        return this.hostname;
    }

    public String imac() {
        // TODO Auto-generated method stub
        return this.mac;
    }

    public String ip() {
        // TODO Auto-generated method stub
        return this.ip;
    }

    public IGroup iunit() {
        // TODO Auto-generated method stub
        return this.unit;
    }

    public IUser iuser() {
        // TODO Auto-generated method stub
        return this.user;
    }

    public String iusername() {
        return this.username;
    }

    public String iunitname() {
        return this.unitname;
    }

    public void reload(Map info) {
        super.reload(info);

        this.activity = (WActivity) info.get("ACTIVITY");
        this.ip = (String) info.get("E_IP");
        this.hostname = (String) info.get("E_HOSTNAME");
        this.mac = (String) info.get("E_MAC");
        this.user = (IUser) info.get("USER");
        this.username = (String) info.get("USER_NAME");
        this.unit = (IGroup) info.get("GROUP");
        this.unitname = (String) info.get("UNIT_NAME");
        this.postname = (String) info.get("POST_NAME");
    }
}
